from django.conf.urls import url, include
from rest_framework_jwt.views import obtain_jwt_token

from . import views

urlpatterns = [
    # /users/usernames/(?P<username>\w{5,20})/count/
    url(r'^usernames/(?P<username>\w{5,20})/count/$', views.RegisterUsernameCountAPIView.as_view(),
        name='usernamecount'),

    # /users/phones/(?P<mobile>1[345789]\d{9})/count/
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$', views.RegisterPhoneCountAPIView.as_view(),
        name='phonecount'),
    url(r'^$', views.RegisterCreateView.as_view()),
    url(r'auths/', obtain_jwt_token, name='auths'),
    # GET /users/infos/
    url(r'^infos/$', views.UserDetailView.as_view(), name='detail'),
    # GET /users/emails/
    url(r'^emails/$', views.EmailView.as_view(), name='emails'),
    # GET users/emails/verification/?token=xxxx
    url(r'^emails/verification/$', views.VerificationEmailView.as_view(), name='verificationemails'),
]
